<?php
/**
 * includes/debug.php
 *
 * Log and Warning debug functions
 *
 * Author: BCG
 *
 */

//
//	log debug messages to plugin operating directory
//

	function as_log($msg)
	{
		global $path,$slash;

		$msg = preg_replace('/\t/',"",$msg);

		if($path && $slash && DEBUG)
			error_log($msg."\n\n",3,$path.$slash."debug.log");
		elseif(@TEST && DEBUG)
			echo("\n$msg");
	}

//
//	display message on admin pages if debug or reset are enabled
//

	function as_warning()
	{
		global $path,$slash;

		if(DEBUG)
			echo('
				<div id="admin-ssl-debug-warning" class="error fade">
					<p><strong>Admin SSL</strong> is currently debugging to: '.$path.$slash.'debug.log</p>
				</div>
			');

		if(RESET)
			echo('
				<div id="admin-ssl-reset-warning" class="error fade">
					<p><strong>Admin SSL</strong> is currently in reset mode - you will not
					be able to secure your site with SSL until you disable reset mode.</p>
				</div>
			');
	}
?>